<?php echo $header; ?>
<div class="col1 float_left">
<div class="col1_content p20r p15t brsolid" >

<p class="tt1 whitetext"><?php echo $heading_title; ?></p><br/>
<?php 
$no_product=0;
if ($description) 
{ 
?>
    <div style="margin-bottom: 15px;"><?php echo $description; ?></div>
<?php 
}

if (!$categories && !$products) 
{ 
	$no_product=1;
?>
    <div class="content"><?php echo $text_error; ?></div>
<?php 
}
	
// NDK - sub category
if ($categories)
{ 
		echo '<h3 style="text-decoration:underline; font-weight:bold">'.$heading_title_subcategory.':</h3><br />';
		$n=count($categories);
		$i=0;

	foreach ($categories as $category) 
	{ 
		if($i%4==0)
		{
			echo '<div class="w702 m15b">';
		}
		if(($i%4==3) || ($i==($n-1)))
		{

	?>
			<div class="w153 float_left"> <a href="<?php echo str_replace('&', '&amp;', $category['href']); ?>"><img src="<?php echo $category['thumb']; ?>" /></a>
              <p class="p10t"><a href="<?php echo str_replace('&', '&amp;', $category['href']); ?>"><?php echo $category['name']; ?></a></p>
			</div>
	<?php		
		}
		else
		{
	?>
	 		<div class="w153 m30r float_left"><a href="<?php echo str_replace('&', '&amp;', $category['href']); ?>"><img src="<?php echo $category['thumb']; ?>" /></a>
              <p class="p10t"><a href="<?php echo str_replace('&', '&amp;', $category['href']); ?>"><?php echo $category['name']; ?></a></p>
			</div>
	<?php		
		}
		
		if(($i%4==3) || ($i==($n-1)))
		{
			echo '<br style="clear:both" /><div class="bbdot p15t"></div></div>';
		}
	?>
           
<?php 
	$i++;
	} 
?>

<?php 
} 
// END Sub category
		if ($no_product==0)
		{
?>		  
			<p class="tt1 whitetext"><?php echo $heading_title_product; ?></p><br/>
<?php 
		}
// NDK - display products of this category
if ($products) 
{ 

// Filter of product
?>
      <p align="right" style="padding-right:5px" ><?php echo $text_sort; ?>
        <select name="sort" onchange="location = this.value">
          <?php foreach ($sorts as $sorts) { ?>
          <?php if (($sort . '-' . $order) == $sorts['value']) { ?>
          <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
          <?php } else { ?>
          <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
          <?php } ?>
          <?php } ?>
        </select>
      </p><br/><br/>

<?php 
		$n=count($products);
		$i=0;
	foreach ($products as $product) 
	{ 
		if($i%4==0)
		{
			echo '<div class="w702 m15b">';
		}
		if(($i%4==3) || ($i==($n-1)))
		{

	?>
			<div class="w153 float_left"> <a href="<?php echo str_replace('&', '&amp;', $product['href']); ?>"><img src="<?php echo $product['thumb']; ?>" /></a>
              <p class="p10t"><a href="<?php echo str_replace('&', '&amp;', $product['href']); ?>"><?php echo $product['name']; ?></a></p>
              <p class="yellowtext">
			  Price: 
			  <?php 
			  if ($display_price) 
			  { 
			  	 if (!$product['special']) 
					{ 
				 		echo $product['price']; 
					} 
					else 
					{ 
					?>
          <span style="font-size: 11px; color: #900; text-decoration: line-through;"><?php echo $product['price']; ?></span> <span style="font-size: 11px; color: #F00;"><?php echo $product['special']; ?></span>
			  <?php 
			  	}
			  } 
			  ?>
			  </p>              
			  <?php if ($product['rating']) { ?>
			  <!--<img src="catalog/view/theme/default/image/stars_<?php echo $product['rating'] . '.png'; ?>" alt="<?php echo $product['stars']; ?>" /><br />-->
			  <?php } ?>
			  <!--<a href="<?php echo $product['add']; ?>" class="button_add_small"><img src="catalog/view/theme/w4u/img/but.png" class="p10t"/></a> -->
			</div>
	<?php		
		}
		else
		{
	?>
	 		<div class="w153 m30r float_left"><a href="<?php echo str_replace('&', '&amp;', $product['href']); ?>"><img src="<?php echo $product['thumb']; ?>" /></a>
              <p class="p10t"><a href="<?php echo str_replace('&', '&amp;', $product['href']); ?>"><?php echo $product['name']; ?></a></p>
              <p class="yellowtext">
			  Price: 
			  <?php 
			  if ($display_price) 
			  { 
			  	 if (!$product['special']) 
					{ 
				 		echo $product['price']; 
					} 
					else 
					{ 
					?>
          <span style="font-size: 11px; color: #900; text-decoration: line-through;"><?php echo $product['price']; ?></span> <span style="font-size: 11px; color: #F00;"><?php echo $product['special']; ?></span>
			  <?php 
			  	}
			  } 
			  ?>
			  </p>              
			  <?php if ($product['rating']) { ?>
			  <!--<img src="catalog/view/theme/default/image/stars_<?php echo $product['rating'] . '.png'; ?>" alt="<?php echo $product['stars']; ?>" /><br />-->
			  <?php } ?>
			  <!--<a href="<?php echo $product['add']; ?>" class="button_add_small"><img src="catalog/view/theme/w4u/img/but.png" class="p10t"/></a> -->
			  
			</div>
	<?php		
		}
		
		if(($i%4==3) || ($i==($n-1)))
		{
			echo '<br style="clear:both" /><div class="bbdot p15t"></div></div>';
		}

	$i++;
} 

// NDK - Pagination
?>		  
	<div class="w702 m15b p10t">
	<?php echo $pagination; ?>
	<br style="clear:both">
	</div>
<?php 
} 
?>   
</div>
</div>
<?php echo $column_right; ?>
<?php echo $footer; ?> 